/**
=====================================================================================
 CButtonAutoRepeat
 copyright M.Jurkait 2003

 Description:
  A CButton which will repeatly send BN_CLICKED if mouse button down (and on this control)

    change:
        * added custom coloring
=====================================================================================
**/
#pragma once



class CButtonAutoRepeat : public CButton
{
        DECLARE_DYNAMIC(CButtonAutoRepeat)

    public:
        CButtonAutoRepeat();
        virtual ~CButtonAutoRepeat();

    protected:
        DECLARE_MESSAGE_MAP()
    public:
        afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
        afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
        afx_msg void OnTimer(UINT nIDEvent);
        afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
        afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
        afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
        virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);

        void    SetBackground(COLORREF col);
        void    SetDefaultBackground();

    protected:
        UINT sent;

    private:
        bool        mb_use_custom_color;
        COLORREF    m_custom_color;
};


